---
description: "Reference for Nitric's v0 .NET library - Creates a new Collection."
---

# .NET - Collection()

Creates a new Collection.

```csharp
using Nitric.Sdk;
using Nitric.Sdk.Resource;

class Profile
{
  public string Name { get; set; }
  public float Age { get; set; }
}

var profiles = Nitric.Collection<Profile>("profiles").With(
  CollectionPermission.Reading, CollectionPermission.Writing, CollectionPermission.Deleting
);

Nitric.Run();
```

## Parameters

<Properties>
  <Property name="name" required type="string">
    The unique name of this Collection within the app. Subsequent calls to
    `Collection` with the same name will return the same object.
  </Property>
</Properties>

## Access

All Nitric resources provide access permissions you can use to specify the level of access your code needs to the resource. See here for details about infrastructure [security](/get-started/foundations/infrastructure/security).

### Available permissions:

---

**CollectionPermission.Reading**

This permission allows your code to read and query documents from the collection.

---

**CollectionPermission.Writing**

This permission allows your code to write documents to the collection.

---

**CollectionPermission.Deleting**

This permission allows your code to delete documents from the collection.

---

## Examples

### Create a collection

```csharp
using Nitric.Sdk;
using Nitric.Sdk.Resource;

class Profile
{
  public string Name { get; set; }
  public float Age { get; set; }
}

var profiles = Nitric.Collection<Profile>("profiles").With(
  CollectionPermission.Reading, CollectionPermission.Writing, CollectionPermission.Deleting
);

Nitric.Run();
```
